inherited dm_tipo_armazenamento: Tdm_tipo_armazenamento
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  a.cod_armazenamento,'
      '  a.descricao,'
      '  a.situacao,'
      '  a.data_cad,'
      '  a.data_alteracao,'
      '  case'
      '    when a.situacao = '#39'True'#39' then '#39'ATIVO'#39' else '#39'INATIVO'#39
      '  end as situacao_desc,'
      
        '  (select count(b.lig_cod_produto) from produto_armazenamento b ' +
        'where b.lig_cod_tipo_armazenamento = a.cod_armazenamento) as tot' +
        'al'
      'from TIPO_ARMAZENAMENTO a'
      'where a.cod_armazenamento > 0')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_ARMAZENAMENTO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_ARMAZENAMENTO'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 300
    end
    object cdsConsultaSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
    object cdsConsultaTOTAL: TIntegerField
      Alignment = taCenter
      FieldName = 'TOTAL'
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_tipo_armazenamento,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_ARMAZENAMENTO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_ARMAZENAMENTO'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 300
    end
    object cdsRegistroSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '  a.cod_armazenamento,'
      '  a.descricao,'
      '  a.situacao,'
      '  a.data_cad,'
      '  a.data_alteracao'
      'from TIPO_ARMAZENAMENTO a'
      'where a.cod_armazenamento = :codigo')
  end
end
